<html>
<body>
<p>
  Reports any actions that are registered in the <code>plugin.xml</code> file and instantiate
  the <code>com.intellij.openapi.actionSystem.Presentation</code> object in their constructors.
</p>
<p>
  Any of the constructors of <code>AnAction</code> with parameters instantiate the <code>Presentation</code>
  object. However, instantiating the <code>Presentation</code> object in constructor results in allocating
  resources, which may not be necessary. Instead of creating an instance of <code>Presentation</code> that
  stores text, description, or icon, it is more efficient to utilize no-argument constructors of
  <code>AnAction</code> and other base classes and follow the convention for setting the text, description,
  and icon in <code>plugin.xml</code>. The IDE will load text, description, and icon only when the action
  is actually displayed in the UI.
</p>
<p>
  The convention for setting the text, description, and icon is as follows:
</p>
<ul>
  <li>
    Set the <code>id</code> attribute for the action in the <code>plugin.xml</code> file.
  </li>
  <li>
    Optionally, set the <code>icon</code> attribute if an icon is needed.
  </li>
  <li>
    Set the text and description in the associated message bundle (it could be overridden in <code>&lt;actions&gt;</code>):
    <ul>
      <li><code>action.&lt;action-id&gt;.text=Translated Action Text</code></li>
      <li><code>action.&lt;action-id&gt;.description=Translated Action Description</code></li>
    </ul>
  </li>
</ul>
<p><b>Bad example:</b></p>
<pre><code lang="kotlin">
  // NewKotlinFileAction.kt
  internal class NewKotlinFileAction : AnAction(
    KotlinBundle.message("action.new.file.text"),
    KotlinBundle.message("action.new.file.description"),
    KotlinIcons.FILE
  )
</code></pre>
<pre><code lang="xml">
  <!-- plugin.xml -->
  &lt;action
    class="org.jetbrains.kotlin.idea.actions.NewKotlinFileAction"
  &lt;/action&gt;
</code></pre>
<p><b>Good example:</b></p>
<pre><code lang="kotlin">
  // NewKotlinFileAction.kt
  internal class NewKotlinFileAction : AnAction()
</code></pre>
<pre><code lang="xml">
  <!-- plugin.xml -->
  &lt;action
    id="Kotlin.NewFile"
    class="org.jetbrains.kotlin.idea.actions.NewKotlinFileAction"
    icon="org.jetbrains.kotlin.idea.KotlinIcons.FILE">
  &lt;/action&gt;
</code></pre>
<pre><code lang="properties">
  # KotlinBundle.properties
  action.Kotlin.NewFile.text=Kotlin Class/File
  action.Kotlin.NewFile.description=Creates a new Kotlin class or file
</code></pre>

<!-- tooltip end -->
<p><small>New in 2023.2</small></p>
</body>
</html>